# -*- coding: utf-8 -*-#
#-------------------------------------------------------------------------------
# 建立者:        潘炎珍  
# Name:         demo06
# Description:
# Author:       98745
# Date:         2019/3/14
#-------------------------------------------------------------------------------

import pandas
import matplotlib.pyplot as plt
df=pandas.read_csv('gapminder.tsv',sep='\t')
gyl=df.groupby('year')['lifeExp'].mean()
print(gyl)
mgv=df.groupby('year')['gdpPercap'].mean()
print(mgv)
fig,(x1,x2)=plt.subplots(1,2,figsize=(8,4))
x1.plot(gyl)
x2.plot(mgv)
plt.show()